< previous page page_698 next page >

Page 698
Listing 18.5. continued
            strMsg = "BeginTrans"
        Case rdActionCommitTransact '17
            strMsg = "CommitTrans"
        Case rdActionRollbackTransact '18
            strMsg = "RollbackTrans"
        Case rdActionNewParameters '19
            strMsg = "NewParameters"
        Case rdActionNewSQL '20
            strMsg = "NewSQL"
    End Select
    '
    ShowAction = strMsg
    '
End Function
Notice that the Validate event of the RDC has several action values that are not available with the standard Microsoft Jet data control. These additional values come in handy when managing remote data connections.
Now add the PostMsg method to your data-entry form. Listing 18.6 shows the code for this support routine.
Type.gifListing 18.6. Coding the PostMsg subroutine.
Public Sub PostMsg(strMsg As String)
    '
    ' post a message to a text box
    '
    Static lngCounter As Long
    '
    lngCounter = lngCounter + 1
    frmMsgs.txtMsg = Format(lngCounter, "000") & ":" & strMsg & vbCrLf &
arrow.giffrmMsgs.txtMsg
    '
End Sub
As mentioned earlier, the sole purpose of this routine is to post messages to the supporting form so that you can see the progress of data requests using the RDC. Now save the form (FRMDATAENTRY.FRM) and the project (PRJRDC.VBP) before running it.
When you run the project, the message form and the data form appear. Note the messages that have been posted to the support form. Modify the first record (change the value of the Name field) and move the record pointer. You see a number of messages appear in the support form indicating the validation of the new data, the updating of the modified data, and the repositioning of the record pointer on the new record (see Figure 18.6).

 
< previous page page_698 next page >

If you like this book, buy it!